package com.sskj.mqtt.many.mapper;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;

@Configuration
@ConfigurationProperties(prefix = "mqtt")
@Getter
@Setter
public class MqttConfigProperties {
    private List<MqttClientConfig> clients = new ArrayList<>();

    @Getter
    @Setter
    public static class MqttClientConfig {
        private String clientId;
        private String serverHost;
        private int serverPort;
        private String username;
        private String password;
        private boolean cleanSession;
        /**
         * 连接超时时间，单位秒
         */
        private Integer connectionTimeout;
        /**
         * 心跳间隔，单位秒
         */
        private Integer keepAliveInterval;

    }
}
